Imports Clo = Enhancements.Core.Logging
Imports Fun = Enhancements.Basic.Expressions.Functions
Imports Ref = System.Reflection
Imports Sys = System

Namespace Enhancements.Basic.Expressions
    ''' <summary>The exception that is thrown when a compiler's functions collection is not valid.</summary>
    ''' <remarks>The InnerException property holds the exception that leads to the throwing of these exceptions.</remarks>
    <Serializable(), DebuggerStepThrough()> _
    Public NotInheritable Class CompilerFunctionsAreValidNotException
        Inherits CompilerException

        Private Sub New(ByVal _functions() As Fun.Function, ByVal _innerException As Sys.Exception)
            MyBase.New(_innerException)
            Functions = _functions
        End Sub

        Private __Functions() As Fun.Function = {}
        ''' <summary>Gets the functions that caused this exception.</summary>
        Public Property Functions() As Fun.Function()
            Get
                Return __Functions
            End Get
            Private Set(ByVal _value() As Fun.Function)
                __Functions = _value
            End Set
        End Property

        ''' <summary>Throws an exception.</summary>
        ''' <param name="_functions">Functions collection that is causing the exception.</param>
        ''' <param name="_innerException">Exception that led to the throwing of this exception.</param>
        ''' <exception cref="CompilerFunctionsAreValidNotException"> </exception>
        Friend Shared Sub ___Throw(ByVal _functions() As Fun.Function, ByVal _innerException As Sys.Exception)
            Dim _exception As CompilerFunctionsAreValidNotException = New CompilerFunctionsAreValidNotException(_functions, _innerException)

            Throw _exception
        End Sub

    End Class
End Namespace
